-
Notifications
You must be signed in to change notification settings - Fork 672
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SMQ-2546 - Add events to adapters #2659
Conversation
7778d73
to
b39d060
Compare
b39d060
to
a9c77e9
Compare
f5d7ba7
to
badab49
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2659 +/- ##
==========================================
- Coverage 43.87% 38.97% -4.90%
==========================================
Files 350 59 -291
Lines 45718 2876 -42842
==========================================
- Hits 20059 1121 -18938
+ Misses 23438 1655 -21783
+ Partials 2221 100 -2121 ☔ View full report in Codecov by Sentry. |
0d1f132
to
5fd66b6
Compare
ws/handler.go
Outdated
switch { | ||
case strings.HasPrefix(string(s.Password), "Client"): | ||
token = strings.ReplaceAll(string(s.Password), "Client ", "") | ||
default: | ||
token = string(s.Password) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use extractClientSecret
instead.
cf13ed3
to
6bad00d
Compare
6bad00d
to
3c2214e
Compare
ws/events/stream.go
Outdated
|
||
//go:generate mockery --name EventStore --output=../mocks --filename events.go --quiet --note "Copyright (c) Abstract Machines" | ||
type EventStore interface { | ||
Publish(ctx context.Context, clientID, channelID, topic string) error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use subtopic
here, just like in other methods.
http/handler.go
Outdated
if err := h.es.Publish(ctx, clientID, msg.Channel, msg.Subtopic); err != nil { | ||
return errors.Wrap(errFailedPublishEvent, err) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Event store should be wrapper around interfaces. I.e. it should be transparent from the adapter implementation because we are using middlewares. Use same approach we have for all the other services.
c61af1a
to
dd09cd2
Compare
Signed-off-by: Felix Gateru <[email protected]>
Signed-off-by: Felix Gateru <[email protected]>
Signed-off-by: Felix Gateru <[email protected]>
Signed-off-by: Felix Gateru <[email protected]>
Signed-off-by: Felix Gateru <[email protected]>
Signed-off-by: Felix Gateru <[email protected]>
dd09cd2
to
34f71fa
Compare
What type of PR is this?
This is a feature as it adds events to
coap
andws
and updates events inmqtt
.What does this do?
This pr adds
publish
,susbscribe
andunsubscribe
events to the adapters.Which issue(s) does this PR fix/relate to?
Have you included tests for your changes?
No
Did you document any new/modified feature?
Yes, in code docuementation is included
Notes
None